package com.qf.order.config;


import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import org.springframework.context.annotation.Configuration;

import javax.servlet.http.HttpServletRequest;

@Configuration
public class BlackAndWhiteNameListConfig implements RequestOriginParser {

    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        // 获取请求ip，并返回即可
        return httpServletRequest.getRemoteAddr();
    }
}
